import request from '@/utils/request'

// 创建商品属性
export function createGoodsAttribute(data) {
  return request({
    url: '/supplier/goods-attribute/create',
    method: 'post',
    data: data
  })
}

// 更新商品属性
export function updateGoodsAttribute(data) {
  return request({
    url: '/supplier/goods-attribute/update',
    method: 'put',
    data: data
  })
}

// 删除商品属性
export function deleteGoodsAttribute(id) {
  return request({
    url: '/supplier/goods-attribute/delete?id=' + id,
    method: 'delete'
  })
}

// 获得商品属性
export function getGoodsAttribute(id) {
  return request({
    url: '/supplier/goods-attribute/get?id=' + id,
    method: 'get'
  })
}

// 获得商品属性分页
export function getGoodsAttributePage(query) {
  return request({
    url: '/supplier/goods-attribute/page',
    method: 'get',
    params: query
  })
}

// 获得商品属性集合
export function getGoodsAttributeList(query) {
  return request({
    url: '/supplier/goods-attribute/list',
    method: 'get',
    params: query
  })
}

// 导出商品属性 Excel
export function exportGoodsAttributeExcel(query) {
  return request({
    url: '/supplier/goods-attribute/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
